// parking_common.h
#ifndef PARKING_COMMON_H
#define PARKING_COMMON_H

#include <stdint.h>
#include <inttypes.h>

// 完全保持您原有的数据结构
// 扩展停车场数据结构
// 修改parking_data_t结构体，使用固定宽度类型
// interface_display.h
// 使用编译器属性强制8字节对齐
typedef struct __attribute__((aligned(8)))
{
    // 基础停车数据
    int32_t total_spaces;
    int32_t available_spaces;
    int32_t occupied_spaces;
    int32_t utilization_rate;

    // 环境数据
    int32_t temperature;
    int32_t humidity;
    int32_t light_level;
    int32_t air_quality;

    // 进出统计
    int32_t vehicles_in;
    int32_t vehicles_out;
    int32_t vehicles_current;

    // 时间戳
    int64_t timestamp;
    int32_t peak_hour_flag;

    // 楼层数据
    int32_t floor_b1_total;
    int32_t floor_b1_available;
    int32_t floor_b1_utilization;

    int32_t floor_b2_total;
    int32_t floor_b2_available;
    int32_t floor_b2_utilization;

    int32_t floor_b3_total;
    int32_t floor_b3_available;
    int32_t floor_b3_utilization;

    // 客户行为分析
    int32_t avg_parking_time_x100;
    int32_t avg_consumption_x100;
    int32_t member_ratio;

    // 停车时长分布
    int32_t parking_time_less_1h;
    int32_t parking_time_1_2h;
    int32_t parking_time_2_4h;
    int32_t parking_time_more_4h;

    // 车牌识别数据
    int32_t recognized_vehicles;
    int32_t unrecognized_rate_x100;
    int32_t vehicle_type_truck;
    int32_t vehicle_type_suv;
    int32_t vehicle_type_car;

    // 客户反馈数据
    char common_feedback[64];
    int32_t avg_waiting_time_x100;
    int32_t facility_score_x100;
    int32_t service_score_x100;
    int32_t satisfaction_score;

    // 高峰时段数据
    int32_t hour_6_count;
    int32_t hour_8_count;
    int32_t hour_10_count;
    int32_t hour_12_count;
    int32_t hour_14_count;
    int32_t hour_16_count;
    int32_t hour_18_count;
    int32_t hour_20_count;
} parking_data_t;

#endif